<?php

/*

Buds (buds.php)

*/

$page_title = "Buds";
$rank_check = 1;
include "header.inc.php";

$buds = mysql_query("SELECT * FROM buds2 WHERE bud_me = '$userid'");

$x = 1;
while ($array = mysql_fetch_array($buds))
{
	$buddy = fetch("SELECT display_name,username FROM members2 WHERE id = '$array[bud_you]' AND game = '$game'");

	if (!$array[bud_note]) { $array[bud_note] = "<i>No notes on this buddy.</i>"; }

	$mybuds .= "
	<TABLE CELLSPACING=5 CELLPADDING=0 WIDTH=95% BGCOLOR=\"$reallyLight\">
		<TR>
			<TD VALIGN=top>
			 <P><a href=user_profile.php?user=$buddy[username]&game=$game><FONT SIZE=\"+1\"
color=#000000><b>$buddy[display_name]</b></FONT></a>
			 <BR><FONT SIZE=\"-1\"><I>
			 <a href=buds_edit.php?game=$game&bud=$array[bud_you]>Edit</a>,
		     <a href=delete_bud.pro.php?game=$game&bud=$array[bud_you]><font
color=red>Remove</font></a></I></FONT>
			 </P>

			 <P><font size=-1><B>Notes:</B> $array[bud_note]</font></P>
			</TD>
		</TR>
	</TABLE><br>";
}

ECHO <<<END

$openHTML

<p align=center><FONT SIZE="+1"><A HREF="wholikesme.php?game=$game"><B>Who likes me?</B></A></FONT></p>

<center>$mybuds</center>

<P align=center>
<TABLE BGCOLOR="$tableOutline" CELLSPACING=1 CELLPADDING=0 WIDTH=300>
   <TR BGCOLOR="$topAndBottomBG">
      <TD COLSPAN=2 HEIGHT=50>
         <p align=center class=white><FONT SIZE="+2"><B>--Add
         Buddy--</B></FONT></p>
      </TD>
   </TR>
   <TR BGCOLOR="$maincellColor">
      <TD WIDTH=100 HEIGHT=25>
         <CENTER>Username:</CENTER>
      </TD>
      <TD HEIGHT=25>
         <P> <form action=$base_url/addbud.pro.php method=post><INPUT TYPE=text NAME=buddy VALUE="$bud" SIZE=33></P>
      </TD>
   </TR>
   <TR BGCOLOR="$middleBG">
      <TD WIDTH=100>
         <CENTER>Note:</CENTER>
      </TD>
      <TD>
         <P> <TEXTAREA NAME=note ROWS=7 COLS=31 WRAP=virtual></TEXTAREA></P>
      </TD>
   </TR>
   <TR BGCOLOR="$topAndBottomBG">
      <TD COLSPAN=2 HEIGHT=40>
         <CENTER><input type=submit name=Submit></form></CENTER>
      </TD>
   </TR>
</TABLE>
</P></CENTER>
$closeHTML

END;

?>